package rabbitmq.utils;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

public class MqUtil {

    public Channel getChananel(){
        try {
            ConnectionFactory factory = new ConnectionFactory();
            factory.setUsername("admin");
            factory.setPort(5672);
            factory.setPassword("123");
            factory.setHost("212.64.48.240");
            Connection connection = factory.newConnection();

            return connection.createChannel();
        } catch (Exception e){
            System.out.println(e);
        }
        return null;
    }

}
